package com.lance.springbootes.model;

import com.lance.springbootes.constants.EsConsts;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @Classname Goods
 * @Description
 * @Date 2022/2/16 17:37
 * @Author lance
 */
@Data
@Builder
@Document(indexName = EsConsts.GOODS_INDEX_NAME, type = EsConsts.GOODS_INDEX_NAME, shards = 1, replicas =1)
@NoArgsConstructor
@AllArgsConstructor
public class Goods {

    @Id
    private String id;
    // @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    private String price;

    @Field(index = false)
    private String img;
}
